<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\vis\analysis\api\service\model;

class VopSiInvInfoForSpecialVendorQueryResponse {
	
	static $_TSPEC;
	public $vendor_code = null;
	public $vendor_name = null;
	public $brand_code = null;
	public $brand_name = null;
	public $item_code = null;
	public $item_name = null;
	public $part_number = null;
	public $on_hand_qty = null;
	public $sellable_qty = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'vendor_code'
			),
			2 => array(
			'var' => 'vendor_name'
			),
			3 => array(
			'var' => 'brand_code'
			),
			4 => array(
			'var' => 'brand_name'
			),
			5 => array(
			'var' => 'item_code'
			),
			6 => array(
			'var' => 'item_name'
			),
			7 => array(
			'var' => 'part_number'
			),
			8 => array(
			'var' => 'on_hand_qty'
			),
			9 => array(
			'var' => 'sellable_qty'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['vendor_code'])){
				
				$this->vendor_code = $vals['vendor_code'];
			}
			
			
			if (isset($vals['vendor_name'])){
				
				$this->vendor_name = $vals['vendor_name'];
			}
			
			
			if (isset($vals['brand_code'])){
				
				$this->brand_code = $vals['brand_code'];
			}
			
			
			if (isset($vals['brand_name'])){
				
				$this->brand_name = $vals['brand_name'];
			}
			
			
			if (isset($vals['item_code'])){
				
				$this->item_code = $vals['item_code'];
			}
			
			
			if (isset($vals['item_name'])){
				
				$this->item_name = $vals['item_name'];
			}
			
			
			if (isset($vals['part_number'])){
				
				$this->part_number = $vals['part_number'];
			}
			
			
			if (isset($vals['on_hand_qty'])){
				
				$this->on_hand_qty = $vals['on_hand_qty'];
			}
			
			
			if (isset($vals['sellable_qty'])){
				
				$this->sellable_qty = $vals['sellable_qty'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'VopSiInvInfoForSpecialVendorQueryResponse';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("vendor_code" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->vendor_code);
				
			}
			
			
			
			
			if ("vendor_name" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->vendor_name);
				
			}
			
			
			
			
			if ("brand_code" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->brand_code);
				
			}
			
			
			
			
			if ("brand_name" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->brand_name);
				
			}
			
			
			
			
			if ("item_code" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->item_code);
				
			}
			
			
			
			
			if ("item_name" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->item_name);
				
			}
			
			
			
			
			if ("part_number" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->part_number);
				
			}
			
			
			
			
			if ("on_hand_qty" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->on_hand_qty); 
				
			}
			
			
			
			
			if ("sellable_qty" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->sellable_qty); 
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->vendor_code !== null) {
			
			$xfer += $output->writeFieldBegin('vendor_code');
			$xfer += $output->writeString($this->vendor_code);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->vendor_name !== null) {
			
			$xfer += $output->writeFieldBegin('vendor_name');
			$xfer += $output->writeString($this->vendor_name);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->brand_code !== null) {
			
			$xfer += $output->writeFieldBegin('brand_code');
			$xfer += $output->writeString($this->brand_code);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->brand_name !== null) {
			
			$xfer += $output->writeFieldBegin('brand_name');
			$xfer += $output->writeString($this->brand_name);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->item_code !== null) {
			
			$xfer += $output->writeFieldBegin('item_code');
			$xfer += $output->writeString($this->item_code);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->item_name !== null) {
			
			$xfer += $output->writeFieldBegin('item_name');
			$xfer += $output->writeString($this->item_name);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->part_number !== null) {
			
			$xfer += $output->writeFieldBegin('part_number');
			$xfer += $output->writeString($this->part_number);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->on_hand_qty !== null) {
			
			$xfer += $output->writeFieldBegin('on_hand_qty');
			$xfer += $output->writeI64($this->on_hand_qty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->sellable_qty !== null) {
			
			$xfer += $output->writeFieldBegin('sellable_qty');
			$xfer += $output->writeI64($this->sellable_qty);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>